<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/limh/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/limh/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/limh/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/limh/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/limh/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/limh/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/limh/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="教程,">










<meta name="description" content="简介C 标准库的 ctype.h 头文件提供了一些函数，可用于测试和映射字符。 这些函数接受 int 作为参数，它的值必须是 EOF 或表示为一个无符号字符。 如果参数 c 满足描述的条件，则这些函数返回非零（true）。如果参数 c 不满足描述的条件，则这些函数返回零。 库函数下面列出了头文件 ctype.h 中定义的函数：    序号 函数 &amp;amp; 描述     1 int isalnum">
<meta name="keywords" content="教程">
<meta property="og:type" content="article">
<meta property="og:title" content="ctype.h">
<meta property="og:url" content="https://tdnr.gitee.io/limh/2015/03/02/cfunc02/index.html">
<meta property="og:site_name" content="土逗牛肉">
<meta property="og:description" content="简介C 标准库的 ctype.h 头文件提供了一些函数，可用于测试和映射字符。 这些函数接受 int 作为参数，它的值必须是 EOF 或表示为一个无符号字符。 如果参数 c 满足描述的条件，则这些函数返回非零（true）。如果参数 c 不满足描述的条件，则这些函数返回零。 库函数下面列出了头文件 ctype.h 中定义的函数：    序号 函数 &amp;amp; 描述     1 int isalnum">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2019-01-20T03:39:09.434Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="ctype.h">
<meta name="twitter:description" content="简介C 标准库的 ctype.h 头文件提供了一些函数，可用于测试和映射字符。 这些函数接受 int 作为参数，它的值必须是 EOF 或表示为一个无符号字符。 如果参数 c 满足描述的条件，则这些函数返回非零（true）。如果参数 c 不满足描述的条件，则这些函数返回零。 库函数下面列出了头文件 ctype.h 中定义的函数：    序号 函数 &amp;amp; 描述     1 int isalnum">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/limh/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://tdnr.gitee.io/limh/2015/03/02/cfunc02/">





  <title>ctype.h | 土逗牛肉</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans ">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/limh/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">土逗牛肉</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/limh/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/limh/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/limh/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/limh/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/limh/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://tdnr.gitee.io/limh/limh/2015/03/02/cfunc02/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="土逗牛肉">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/limh/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="土逗牛肉">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">ctype.h</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2015-03-02T20:35:45+08:00">
                2015-03-02
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/limh/categories/C函数库/" itemprop="url" rel="index">
                    <span itemprop="name">C函数库</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p>C 标准库的 ctype.h 头文件提供了一些函数，可用于测试和映射字符。</p>
<p>这些函数接受 int 作为参数，它的值必须是 EOF 或表示为一个无符号字符。</p>
<p>如果参数 c 满足描述的条件，则这些函数返回非零（true）。如果参数 c 不满足描述的条件，则这些函数返回零。</p>
<h2 id="库函数"><a href="#库函数" class="headerlink" title="库函数"></a>库函数</h2><p>下面列出了头文件 ctype.h 中定义的函数：</p>
<table>
<thead>
<tr>
<th>序号</th>
<th>函数 &amp; 描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td><strong>int isalnum(int c)</strong> <br> 该函数检查所传的字符是否是字母和数字。</td>
</tr>
<tr>
<td>2</td>
<td><strong>int isalpha(int c)</strong> <br> 该函数检查所传的字符是否是字母。</td>
</tr>
<tr>
<td>3</td>
<td><strong>int iscntrl(int c)</strong> <br> 该函数检查所传的字符是否是控制字符。</td>
</tr>
<tr>
<td>4</td>
<td><strong>int isdigit(int c)</strong> <br> 该函数检查所传的字符是否是十进制数字。</td>
</tr>
<tr>
<td>5</td>
<td><strong>int isgraph(int c)</strong> <br> 该函数检查所传的字符是否有图形表示法。</td>
</tr>
<tr>
<td>6</td>
<td><strong>int islower(int c)</strong> <br> 该函数检查所传的字符是否是小写字母。</td>
</tr>
<tr>
<td>7</td>
<td><strong>int isprint(int c)</strong> <br> 该函数检查所传的字符是否是可打印的。</td>
</tr>
<tr>
<td>8</td>
<td><strong>int ispunct(int c)</strong> <br> 该函数检查所传的字符是否是标点符号字符。</td>
</tr>
<tr>
<td>9</td>
<td><strong>int isspace(int c)</strong> <br> 该函数检查所传的字符是否是空白字符。</td>
</tr>
<tr>
<td>10</td>
<td><strong>int isupper(int c)</strong> <br> 该函数检查所传的字符是否是大写字母。</td>
</tr>
<tr>
<td>11</td>
<td><strong>int isxdigit(int c)</strong> <br> 该函数检查所传的字符是否是十六进制数字。</td>
</tr>
<tr>
<td>12</td>
<td><strong>int tolower(int c)</strong> <br> 该函数把大写字母转换为小写字母。</td>
</tr>
<tr>
<td>13</td>
<td><strong>int toupper(int c)</strong> <br> 该函数把小写字母转换为大写字母。</td>
</tr>
</tbody>
</table>
<h2 id="函数用例"><a href="#函数用例" class="headerlink" title="函数用例"></a>函数用例</h2><h3 id="一、int-isalnum-int-c"><a href="#一、int-isalnum-int-c" class="headerlink" title="一、int isalnum(int c)"></a>一、int isalnum(int c)</h3><h4 id="描述"><a href="#描述" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 void isalnum(int c) 检查所传的字符是否是字母和数字。</p>
<h4 id="声明"><a href="#声明" class="headerlink" title="声明"></a>声明</h4><p>下面是 isalnum() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int isalnum(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数"><a href="#参数" class="headerlink" title="参数"></a>参数</h4><ul>
<li>c – 这是要检查的字符。</li>
</ul>
<h4 id="返回值"><a href="#返回值" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 是一个数字或一个字母，则该函数返回非零值，否则返回 0。</p>
<h4 id="实例"><a href="#实例" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 isalnum() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"></span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">   int var1 = &apos;d&apos;;</span><br><span class="line">   int var2 = &apos;2&apos;;</span><br><span class="line">   int var3 = &apos;\t&apos;;</span><br><span class="line">   int var4 = &apos; &apos;;</span><br><span class="line">    </span><br><span class="line">   if( isalnum(var1) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var1 = |%c| 是字母数字\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var1 = |%c| 不是字母数字\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isalnum(var2) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var2 = |%c| 是字母数字\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var2 = |%c| 不是字母数字\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isalnum(var3) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var3 = |%c| 是字母数字\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var3 = |%c| 不是字母数字\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isalnum(var4) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var4 = |%c| 是字母数字\n&quot;, var4 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var4 = |%c| 不是字母数字\n&quot;, var4 );</span><br><span class="line">   &#125;</span><br><span class="line">    </span><br><span class="line">   return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>var1 = |d| 是字母数字<br>var2 = |2| 是字母数字<br>var3 = | | 不是字母数字<br>var4 = | | 不是字母数字</p>
</blockquote>
<h3 id="二、isalpha"><a href="#二、isalpha" class="headerlink" title="二、isalpha()"></a>二、isalpha()</h3><h4 id="描述-1"><a href="#描述-1" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 void isalpha(int c) 检查所传的字符是否是字母。</p>
<h4 id="声明-1"><a href="#声明-1" class="headerlink" title="声明"></a>声明</h4><p>下面是 isalpha() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int isalpha(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数-1"><a href="#参数-1" class="headerlink" title="参数"></a>参数</h4><p>c – 这是要检查的字符。</p>
<h4 id="返回值-1"><a href="#返回值-1" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 是一个字母，则该函数返回非零值，否则返回 0。</p>
<h4 id="实例-1"><a href="#实例-1" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 isalpha() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"></span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">   int var1 = &apos;d&apos;;</span><br><span class="line">   int var2 = &apos;2&apos;;</span><br><span class="line">   int var3 = &apos;\t&apos;;</span><br><span class="line">   int var4 = &apos; &apos;;</span><br><span class="line">    </span><br><span class="line">   if( isalpha(var1) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var1 = |%c| 是一个字母\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var1 = |%c| 不是一个字母\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isalpha(var2) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var2 = |%c| 是一个字母\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var2 = |%c| 不是一个字母\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isalpha(var3) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var3 = |%c| 是一个字母\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var3 = |%c| 不是一个字母\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isalpha(var4) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var4 = |%c| 是一个字母\n&quot;, var4 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var4 = |%c| 不是一个字母\n&quot;, var4 );</span><br><span class="line">   &#125;</span><br><span class="line">   </span><br><span class="line">   return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>var1 = |d| 是一个字母<br>var2 = |2| 不是一个字母<br>var3 = | | 不是一个字母<br>var4 = | | 不是一个字母</p>
</blockquote>
<h3 id="三、iscntrl"><a href="#三、iscntrl" class="headerlink" title="三、iscntrl()"></a>三、iscntrl()</h3><h4 id="描述-2"><a href="#描述-2" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 void iscntrl(int c) 检查所传的字符是否是控制字符。</p>
<p>根据标准 ASCII 字符集，控制字符的 ASCII 编码介于 0x00 (NUL) 和 0x1f (US) 之间，以及 0x7f (DEL)，某些平台的特定编译器实现还可以在扩展字符集（0x7f 以上）中定义额外的控制字符。</p>
<h4 id="声明-2"><a href="#声明-2" class="headerlink" title="声明"></a>声明</h4><p>下面是 iscntrl() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int iscntrl(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数-2"><a href="#参数-2" class="headerlink" title="参数"></a>参数</h4><p>c – 这是要检查的字符。</p>
<h4 id="返回值-2"><a href="#返回值-2" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 是一个控制字符，则该函数返回非零值，否则返回 0。</p>
<h4 id="实例-2"><a href="#实例-2" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 iscntrl() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"></span><br><span class="line">int main ()</span><br><span class="line">&#123;</span><br><span class="line">   int i = 0, j = 0;</span><br><span class="line">   char str1[] = &quot;all \a about \t programming&quot;;</span><br><span class="line">   char str2[] = &quot;Runoob \n tutorials&quot;;</span><br><span class="line">  </span><br><span class="line">   /* 输出字符串直到控制字符 \a */</span><br><span class="line">   while( !iscntrl(str1[i]) ) </span><br><span class="line">   &#123;</span><br><span class="line">      putchar(str1[i]);</span><br><span class="line">      i++;</span><br><span class="line">   &#125;</span><br><span class="line">  </span><br><span class="line">   /* 输出字符串直到控制字符 \n */</span><br><span class="line">   while( !iscntrl(str2[j]) ) </span><br><span class="line">   &#123;</span><br><span class="line">      putchar(str2[j]);</span><br><span class="line">      j++;</span><br><span class="line">   &#125;</span><br><span class="line">   </span><br><span class="line">   return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>all Runoob</p>
</blockquote>
<h3 id="四、isdigit"><a href="#四、isdigit" class="headerlink" title="四、isdigit()"></a>四、isdigit()</h3><h4 id="描述-3"><a href="#描述-3" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 void isdigit(int c) 检查所传的字符是否是十进制数字字符。</p>
<p>十进制数字是：0 1 2 3 4 5 6 7 8 9</p>
<h4 id="声明-3"><a href="#声明-3" class="headerlink" title="声明"></a>声明</h4><p>下面是 isdigit() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int isdigit(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数-3"><a href="#参数-3" class="headerlink" title="参数"></a>参数</h4><p>c – 这是要检查的字符。</p>
<h4 id="返回值-3"><a href="#返回值-3" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 是一个数字，则该函数返回非零值，否则返回 0。</p>
<h4 id="实例-3"><a href="#实例-3" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 isdigit() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"></span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">   int var1 = &apos;h&apos;;</span><br><span class="line">   int var2 = &apos;2&apos;;</span><br><span class="line">    </span><br><span class="line">   if( isdigit(var1) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var1 = |%c| 是一个数字\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var1 = |%c| 不是一个数字\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isdigit(var2) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var2 = |%c| 是一个数字\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var2 = |%c| 不是一个数字\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">  </span><br><span class="line">   return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>var1 = |h| 不是一个数字<br>var2 = |2| 是一个数字 </p>
</blockquote>
<h3 id="五、isgraph"><a href="#五、isgraph" class="headerlink" title="五、isgraph()"></a>五、isgraph()</h3><h4 id="描述-4"><a href="#描述-4" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 void isgraph(int c) 检查所传的字符是否有图形表示法。</p>
<p>带有图形表示法的字符是除了空白字符（比如 ‘ ‘）以外的所有可打印的字符。</p>
<h4 id="声明-4"><a href="#声明-4" class="headerlink" title="声明"></a>声明</h4><p>下面是 isgraph() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int isgraph(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数-4"><a href="#参数-4" class="headerlink" title="参数"></a>参数</h4><p>c – 这是要检查的字符。</p>
<h4 id="返回值-4"><a href="#返回值-4" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 有图形表示法，则该函数返回非零值，否则返回 0。</p>
<h4 id="实例-4"><a href="#实例-4" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 isgraph() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"></span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">   int var1 = &apos;3&apos;;</span><br><span class="line">   int var2 = &apos;m&apos;;</span><br><span class="line">   int var3 = &apos; &apos;;</span><br><span class="line">    </span><br><span class="line">   if( isgraph(var1) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var1 = |%c| 是可打印的\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var1 = |%c| 是不可打印的\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isgraph(var2) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var2 = |%c| 是可打印的\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var2 = |%c| 是不可打印的\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isgraph(var3) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var3 = |%c| 是可打印的\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var3 = |%c| 是不可打印的\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   </span><br><span class="line">   return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>var1 = |3| 是可打印的<br>var2 = |m| 是可打印的<br>var3 = | | 是不可打印的</p>
</blockquote>
<h3 id="六、islower"><a href="#六、islower" class="headerlink" title="六、islower()"></a>六、islower()</h3><h4 id="描述-5"><a href="#描述-5" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 int islower(int c) 检查所传的字符是否是小写字母。</p>
<h4 id="声明-5"><a href="#声明-5" class="headerlink" title="声明"></a>声明</h4><p>下面是 islower() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int islower(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数-5"><a href="#参数-5" class="headerlink" title="参数"></a>参数</h4><p>c – 这是要检查的字符。</p>
<h4 id="返回值-5"><a href="#返回值-5" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 是一个小写字母，则该函数返回非零值（true），否则返回 0（false）。</p>
<h4 id="实例-5"><a href="#实例-5" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 islower() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"></span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">   int var1 = &apos;Q&apos;;</span><br><span class="line">   int var2 = &apos;q&apos;;</span><br><span class="line">   int var3 = &apos;3&apos;;</span><br><span class="line">    </span><br><span class="line">   if( islower(var1) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var1 = |%c| 是小写字母\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var1 = |%c| 不是小写字母\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( islower(var2) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var2 = |%c| 是小写字母\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var2 = |%c| 不是小写字母\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( islower(var3) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var3 = |%c| 是小写字母\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var3 = |%c| 不是小写字母\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   </span><br><span class="line">   return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>var1 = |Q| 不是小写字母<br>var2 = |q| 是小写字母<br>var3 = |3| 不是小写字母</p>
</blockquote>
<h3 id="七、isprint"><a href="#七、isprint" class="headerlink" title="七、isprint()"></a>七、isprint()</h3><h4 id="描述-6"><a href="#描述-6" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 int isprint(int c) 检查所传的字符是否是可打印的。可打印字符是非控制字符的字符。</p>
<h4 id="声明-6"><a href="#声明-6" class="headerlink" title="声明"></a>声明</h4><p>下面是 isprint() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int isprint(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数-6"><a href="#参数-6" class="headerlink" title="参数"></a>参数</h4><p>c – 这是要检查的字符。</p>
<h4 id="返回值-6"><a href="#返回值-6" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 是一个可打印的字符，则该函数返回非零值（true），否则返回 0（false）。</p>
<h4 id="实例-6"><a href="#实例-6" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 isprint() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"></span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">   int var1 = &apos;k&apos;;</span><br><span class="line">   int var2 = &apos;8&apos;;</span><br><span class="line">   int var3 = &apos;\t&apos;;</span><br><span class="line">   int var4 = &apos; &apos;;</span><br><span class="line">    </span><br><span class="line">   if( isprint(var1) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var1 = |%c| 是可打印的\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var1 = |%c| 是不可打印的\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isprint(var2) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var2 = |%c| 是可打印的\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var2 = |%c| 是不可打印的\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isprint(var3) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var3 = |%c| 是可打印的\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var3 = |%c| 是不可打印的\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isprint(var4) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var4 = |%c| 是可打印的\n&quot;, var4 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var4 = |%c| 是不可打印的\n&quot;, var4 );</span><br><span class="line">   &#125;</span><br><span class="line">   </span><br><span class="line">   return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>var1 = |k| 是可打印的<br>var2 = |8| 是可打印的<br>var3 = |    | 是不可打印的<br>var4 = | | 是可打印的</p>
</blockquote>
<h3 id="八、ispunct"><a href="#八、ispunct" class="headerlink" title="八、ispunct()"></a>八、ispunct()</h3><h4 id="描述-7"><a href="#描述-7" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 int ispunct(int c) 检查所传的字符是否是标点符号字符。标点符号字符可以是非字母数字（正如 isalnum 中的一样）的任意图形字符（正如 isgraph 中的一样）。</p>
<h4 id="声明-7"><a href="#声明-7" class="headerlink" title="声明"></a>声明</h4><p>下面是 ispunct() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int ispunct(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数-7"><a href="#参数-7" class="headerlink" title="参数"></a>参数</h4><p>c – 这是要检查的字符。</p>
<h4 id="返回值-7"><a href="#返回值-7" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 是一个标点符号字符，则该函数返回非零值（true），否则返回 0（false）。</p>
<h4 id="实例-7"><a href="#实例-7" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 ispunct() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"></span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">   int var1 = &apos;t&apos;;</span><br><span class="line">   int var2 = &apos;1&apos;;</span><br><span class="line">   int var3 = &apos;/&apos;;</span><br><span class="line">   int var4 = &apos; &apos;;</span><br><span class="line"></span><br><span class="line">   if( ispunct(var1) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var1 = |%c| 是标点符号字符\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var1 = |%c| 不是标点符号字符\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( ispunct(var2) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var2 = |%c| 是标点符号字符\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var2 = |%c| 不是标点符号字符\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( ispunct(var3) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var3 = |%c| 是标点符号字符\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var3 = |%c| 不是标点符号字符\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( ispunct(var4) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var4 = |%c| 是标点符号字符\n&quot;, var4 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var4 = |%c| 不是标点符号字符\n&quot;, var4 );</span><br><span class="line">   &#125;</span><br><span class="line">   </span><br><span class="line">   return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>var1 = |t| 不是标点符号字符<br>var2 = |1| 不是标点符号字符<br>var3 = |/| 是标点符号字符<br>var4 = | | 不是标点符号字符</p>
</blockquote>
<h3 id="九、isspace"><a href="#九、isspace" class="headerlink" title="九、isspace()"></a>九、isspace()</h3><h4 id="描述-8"><a href="#描述-8" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 int isspace(int c) 检查所传的字符是否是空白字符。</p>
<p>标准的空白字符包括：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&apos; &apos;     (0x20)    space (SPC) 空格符</span><br><span class="line">&apos;\t&apos;    (0x09)    horizontal tab (TAB) 水平制表符    </span><br><span class="line">&apos;\n&apos;    (0x0a)    newline (LF) 换行符</span><br><span class="line">&apos;\v&apos;    (0x0b)    vertical tab (VT) 垂直制表符</span><br><span class="line">&apos;\f&apos;    (0x0c)    feed (FF) 换页符</span><br><span class="line">&apos;\r&apos;    (0x0d)    carriage return (CR) 回车符</span><br></pre></td></tr></table></figure>
<h4 id="声明-8"><a href="#声明-8" class="headerlink" title="声明"></a>声明</h4><p>下面是 isspace() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int isspace(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数-8"><a href="#参数-8" class="headerlink" title="参数"></a>参数</h4><p>c – 这是要检查的字符。</p>
<h4 id="返回值-8"><a href="#返回值-8" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 是一个空白字符，则该函数返回非零值（true），否则返回 0（false）。</p>
<h4 id="实例-8"><a href="#实例-8" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 isspace() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"></span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">   int var1 = &apos;t&apos;;</span><br><span class="line">   int var2 = &apos;1&apos;;</span><br><span class="line">   int var3 = &apos; &apos;;</span><br><span class="line"></span><br><span class="line">   if( isspace(var1) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var1 = |%c| 是空白字符\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var1 = |%c| 不是空白字符\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isspace(var2) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var2 = |%c| 是空白字符\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var2 = |%c| 不是空白字符\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isspace(var3) )</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var3 = |%c| 是空白字符\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">       printf(&quot;var3 = |%c| 不是空白字符\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   </span><br><span class="line">   return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>var1 = |t| 不是空白字符<br>var2 = |1| 不是空白字符<br>var3 = | | 是空白字符</p>
</blockquote>
<h3 id="十、isupper"><a href="#十、isupper" class="headerlink" title="十、isupper()"></a>十、isupper()</h3><h4 id="描述-9"><a href="#描述-9" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 int isupper(int c) 检查所传的字符是否是大写字母。</p>
<h4 id="声明-9"><a href="#声明-9" class="headerlink" title="声明"></a>声明</h4><p>下面是 isupper() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int isupper(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数-9"><a href="#参数-9" class="headerlink" title="参数"></a>参数</h4><p>c – 这是要检查的字符。</p>
<h4 id="返回值-9"><a href="#返回值-9" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 是一个大写字母，则该函数返回非零值（true），否则返回 0（false）。</p>
<h4 id="实例-9"><a href="#实例-9" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 isupper() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"></span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">   int var1 = &apos;M&apos;;</span><br><span class="line">   int var2 = &apos;m&apos;;</span><br><span class="line">   int var3 = &apos;3&apos;;</span><br><span class="line">    </span><br><span class="line">   if( isupper(var1) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var1 = |%c| 是大写字母\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var1 = |%c| 不是大写字母\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   if( isupper(var2) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var2 = |%c| 是大写字母\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var2 = |%c| 不是大写字母\n&quot;, var2 );</span><br><span class="line">   &#125;   </span><br><span class="line">   if( isupper(var3) )</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var3 = |%c| 是大写字母\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">      printf(&quot;var3 = |%c| 不是大写字母\n&quot;, var3 );</span><br><span class="line">   &#125;</span><br><span class="line">   </span><br><span class="line">   return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>var1 = |M| 是大写字母<br>var2 = |m| 不是大写字母<br>var3 = |3| 不是大写字母</p>
</blockquote>
<h3 id="十一、isxdigit"><a href="#十一、isxdigit" class="headerlink" title="十一、isxdigit()"></a>十一、isxdigit()</h3><h4 id="描述-10"><a href="#描述-10" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 int isxdigit(int c)检查所传的字符是否是十六进制数字。</p>
<h4 id="声明-10"><a href="#声明-10" class="headerlink" title="声明"></a>声明</h4><p>下面是 isxdigit() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int isxdigit(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数-10"><a href="#参数-10" class="headerlink" title="参数"></a>参数</h4><p>c – 这是要检查的字符。</p>
<h4 id="返回值-10"><a href="#返回值-10" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 是一个十六进制数字，则该函数返回非零值（true），否则返回 0（false）。</p>
<h4 id="实例-10"><a href="#实例-10" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 isxdigit() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"></span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">   char var1[] = &quot;tuts&quot;;</span><br><span class="line">   char var2[] = &quot;0xE&quot;;</span><br><span class="line">  </span><br><span class="line">   if( isxdigit(var1[0]) )</span><br><span class="line">   &#123;</span><br><span class="line">     printf(&quot;var1 = |%s| 是十六进制数字\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">     printf(&quot;var1 = |%s| 不是十六进制数字\n&quot;, var1 );</span><br><span class="line">   &#125;</span><br><span class="line">   </span><br><span class="line">   if( isxdigit(var2[0] ))</span><br><span class="line">   &#123;</span><br><span class="line">     printf(&quot;var2 = |%s| 是十六进制数字\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   else</span><br><span class="line">   &#123;</span><br><span class="line">     printf(&quot;var2 = |%s| 不是十六进制数字\n&quot;, var2 );</span><br><span class="line">   &#125;</span><br><span class="line">   </span><br><span class="line">   return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>var1 = |tuts| 不是十六进制数字<br>var2 = |0xE| 是十六进制数字</p>
</blockquote>
<h3 id="十二、tolower"><a href="#十二、tolower" class="headerlink" title="十二、tolower()"></a>十二、tolower()</h3><h4 id="描述-11"><a href="#描述-11" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 int tolower(int c) 把给定的字母转换为小写字母。</p>
<h4 id="声明-11"><a href="#声明-11" class="headerlink" title="声明"></a>声明</h4><p>下面是 tolower() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int tolower(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数-11"><a href="#参数-11" class="headerlink" title="参数"></a>参数</h4><p>c – 这是要被转换为小写的字母。</p>
<h4 id="返回值-11"><a href="#返回值-11" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 有相对应的小写字母，则该函数返回 c 的小写字母，否则 c 保持不变。返回值是一个可被隐式转换为 char 类型的 int 值。</p>
<h4 id="实例-11"><a href="#实例-11" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 tolower() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"> </span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">   int i = 0;</span><br><span class="line">   char c;</span><br><span class="line">   char str[] = &quot;51MCU&quot;;</span><br><span class="line"> </span><br><span class="line">   while( str[i] ) </span><br><span class="line">   &#123;</span><br><span class="line">      putchar(tolower(str[i]));</span><br><span class="line">      i++;</span><br><span class="line">   &#125;</span><br><span class="line"> </span><br><span class="line">   return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>51mcu</p>
</blockquote>
<h3 id="十三、toupper"><a href="#十三、toupper" class="headerlink" title="十三、toupper()"></a>十三、toupper()</h3><h4 id="描述-12"><a href="#描述-12" class="headerlink" title="描述"></a>描述</h4><p>C 库函数 int toupper(int c) 把小写字母转换为大写字母。</p>
<h4 id="声明-12"><a href="#声明-12" class="headerlink" title="声明"></a>声明</h4><p>下面是 toupper() 函数的声明。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">int toupper(int c);</span><br></pre></td></tr></table></figure>
<h4 id="参数-12"><a href="#参数-12" class="headerlink" title="参数"></a>参数</h4><p>c – 这是要被转换为大写的字母。</p>
<h4 id="返回值-12"><a href="#返回值-12" class="headerlink" title="返回值"></a>返回值</h4><p>如果 c 有相对应的大写字母，则该函数返回 c 的大写字母，否则 c 保持不变。返回值是一个可被隐式转换为 char 类型的 int 值。</p>
<h4 id="实例-12"><a href="#实例-12" class="headerlink" title="实例"></a>实例</h4><p>下面的实例演示了 toupper() 函数的用法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;stdio.h&gt;</span><br><span class="line">#include &lt;ctype.h&gt;</span><br><span class="line"></span><br><span class="line">int main()</span><br><span class="line">&#123;</span><br><span class="line">   int i = 0;</span><br><span class="line">   char c;</span><br><span class="line">   char str[] = &quot;mcu&quot;;</span><br><span class="line">   </span><br><span class="line">   while(str[i])</span><br><span class="line">   &#123;</span><br><span class="line">      putchar (toupper(str[i]));</span><br><span class="line">      i++;</span><br><span class="line">   &#125;</span><br><span class="line">   </span><br><span class="line">  return(0);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>让我们编译并运行上面的程序，这将产生以下结果：</p>
<blockquote>
<p>MCU</p>
</blockquote>
<h2 id="字符类"><a href="#字符类" class="headerlink" title="字符类"></a>字符类</h2><table>
<thead>
<tr>
<th>序号</th>
<th>字符类 &amp; 描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td><strong>数字</strong> <br> 完整的数字集合 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }</td>
</tr>
<tr>
<td>2</td>
<td><strong>十六进制数字</strong> <br> 集合 { 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f }</td>
</tr>
<tr>
<td>3</td>
<td><strong>小写字母</strong> <br> 集合 { a b c d e f g h i j k l m n o p q r s t u v w x y z }</td>
</tr>
<tr>
<td>4</td>
<td><strong>大写字母</strong> <br> 集合 {A B C D E F G H I J K L M N O P Q R S T U V W X Y Z }</td>
</tr>
<tr>
<td>5</td>
<td><strong>字母</strong> <br> 小写字母和大写字母的集合</td>
</tr>
<tr>
<td>6</td>
<td><strong>字母数字字符</strong> <br> 数字、小写字母和大写字母的集合</td>
</tr>
<tr>
<td>7</td>
<td><strong>标点符号字符</strong> <br> 集合 ! “ # $ % &amp; ‘ ( ) * + , - . / : ; &lt; = &gt; ? @ [ \ ] ^ _ ` { &#124; } ~</td>
</tr>
<tr>
<td>8</td>
<td><strong>图形字符</strong> <br> 字母数字字符和标点符号字符的集合</td>
</tr>
<tr>
<td>9</td>
<td><strong>空格字符</strong> <br> 制表符、换行符、垂直制表符、换页符、回车符、空格符的集合。</td>
</tr>
<tr>
<td>10</td>
<td><strong>可打印字符</strong> <br> 字母数字字符、标点符号字符和空格字符的集合。</td>
</tr>
<tr>
<td>11</td>
<td><strong>控制字符</strong> <br> 在 ASCII 编码中，这些字符的八进制代码是从 000 到 037，以及 177（DEL）。</td>
</tr>
<tr>
<td>12</td>
<td><strong>空白字符</strong> <br> 包括空格符和制表符。</td>
</tr>
<tr>
<td>13</td>
<td><strong>字母字符</strong> <br> 小写字母和大写字母的集合。</td>
</tr>
</tbody>
</table>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/limh/tags/教程/" rel="tag"># 教程</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/limh/2015/03/01/cfunc01/" rel="next" title="assert.h">
                <i class="fa fa-chevron-left"></i> assert.h
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/limh/2015/03/03/cfunc03/" rel="prev" title="errno.h">
                errno.h <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="SOHUCS"></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/limh/images/avatar.jpg" alt="土逗牛肉">
            
              <p class="site-author-name" itemprop="name">土逗牛肉</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/limh/archives/">
              
                  <span class="site-state-item-count">255</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/limh/categories/index.html">
                  <span class="site-state-item-count">8</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/limh/tags/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/limhGeek" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:1591054297@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.jianshu.com/u/f73b243e7cc9" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-user-circle-o"></i>简书</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#简介"><span class="nav-number">1.</span> <span class="nav-text">简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#库函数"><span class="nav-number">2.</span> <span class="nav-text">库函数</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#函数用例"><span class="nav-number">3.</span> <span class="nav-text">函数用例</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#一、int-isalnum-int-c"><span class="nav-number">3.1.</span> <span class="nav-text">一、int isalnum(int c)</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述"><span class="nav-number">3.1.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明"><span class="nav-number">3.1.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数"><span class="nav-number">3.1.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值"><span class="nav-number">3.1.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例"><span class="nav-number">3.1.5.</span> <span class="nav-text">实例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#二、isalpha"><span class="nav-number">3.2.</span> <span class="nav-text">二、isalpha()</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述-1"><span class="nav-number">3.2.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明-1"><span class="nav-number">3.2.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数-1"><span class="nav-number">3.2.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值-1"><span class="nav-number">3.2.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例-1"><span class="nav-number">3.2.5.</span> <span class="nav-text">实例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#三、iscntrl"><span class="nav-number">3.3.</span> <span class="nav-text">三、iscntrl()</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述-2"><span class="nav-number">3.3.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明-2"><span class="nav-number">3.3.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数-2"><span class="nav-number">3.3.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值-2"><span class="nav-number">3.3.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例-2"><span class="nav-number">3.3.5.</span> <span class="nav-text">实例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#四、isdigit"><span class="nav-number">3.4.</span> <span class="nav-text">四、isdigit()</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述-3"><span class="nav-number">3.4.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明-3"><span class="nav-number">3.4.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数-3"><span class="nav-number">3.4.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值-3"><span class="nav-number">3.4.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例-3"><span class="nav-number">3.4.5.</span> <span class="nav-text">实例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#五、isgraph"><span class="nav-number">3.5.</span> <span class="nav-text">五、isgraph()</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述-4"><span class="nav-number">3.5.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明-4"><span class="nav-number">3.5.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数-4"><span class="nav-number">3.5.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值-4"><span class="nav-number">3.5.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例-4"><span class="nav-number">3.5.5.</span> <span class="nav-text">实例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#六、islower"><span class="nav-number">3.6.</span> <span class="nav-text">六、islower()</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述-5"><span class="nav-number">3.6.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明-5"><span class="nav-number">3.6.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数-5"><span class="nav-number">3.6.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值-5"><span class="nav-number">3.6.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例-5"><span class="nav-number">3.6.5.</span> <span class="nav-text">实例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#七、isprint"><span class="nav-number">3.7.</span> <span class="nav-text">七、isprint()</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述-6"><span class="nav-number">3.7.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明-6"><span class="nav-number">3.7.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数-6"><span class="nav-number">3.7.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值-6"><span class="nav-number">3.7.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例-6"><span class="nav-number">3.7.5.</span> <span class="nav-text">实例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#八、ispunct"><span class="nav-number">3.8.</span> <span class="nav-text">八、ispunct()</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述-7"><span class="nav-number">3.8.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明-7"><span class="nav-number">3.8.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数-7"><span class="nav-number">3.8.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值-7"><span class="nav-number">3.8.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例-7"><span class="nav-number">3.8.5.</span> <span class="nav-text">实例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#九、isspace"><span class="nav-number">3.9.</span> <span class="nav-text">九、isspace()</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述-8"><span class="nav-number">3.9.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明-8"><span class="nav-number">3.9.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数-8"><span class="nav-number">3.9.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值-8"><span class="nav-number">3.9.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例-8"><span class="nav-number">3.9.5.</span> <span class="nav-text">实例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#十、isupper"><span class="nav-number">3.10.</span> <span class="nav-text">十、isupper()</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述-9"><span class="nav-number">3.10.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明-9"><span class="nav-number">3.10.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数-9"><span class="nav-number">3.10.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值-9"><span class="nav-number">3.10.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例-9"><span class="nav-number">3.10.5.</span> <span class="nav-text">实例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#十一、isxdigit"><span class="nav-number">3.11.</span> <span class="nav-text">十一、isxdigit()</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述-10"><span class="nav-number">3.11.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明-10"><span class="nav-number">3.11.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数-10"><span class="nav-number">3.11.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值-10"><span class="nav-number">3.11.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例-10"><span class="nav-number">3.11.5.</span> <span class="nav-text">实例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#十二、tolower"><span class="nav-number">3.12.</span> <span class="nav-text">十二、tolower()</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述-11"><span class="nav-number">3.12.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明-11"><span class="nav-number">3.12.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数-11"><span class="nav-number">3.12.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值-11"><span class="nav-number">3.12.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例-11"><span class="nav-number">3.12.5.</span> <span class="nav-text">实例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#十三、toupper"><span class="nav-number">3.13.</span> <span class="nav-text">十三、toupper()</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#描述-12"><span class="nav-number">3.13.1.</span> <span class="nav-text">描述</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#声明-12"><span class="nav-number">3.13.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#参数-12"><span class="nav-number">3.13.3.</span> <span class="nav-text">参数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#返回值-12"><span class="nav-number">3.13.4.</span> <span class="nav-text">返回值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#实例-12"><span class="nav-number">3.13.5.</span> <span class="nav-text">实例</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#字符类"><span class="nav-number">4.</span> <span class="nav-text">字符类</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">土逗牛肉</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
	var str = GetUrlParam('height');
    if (str === '0'){
		document.getElementById('header').style.display = 'none';
		document.getElementById('comments').style.display = 'none';
		document.getElementById('footer').style.display = 'none';
		document.getElementsByClassName('post-footer').item(0).style.display = 'none'
	}
	
    function GetUrlParam(paraName) {
        var url = document.location.toString();
        var arrObj = url.split("?");

        if (arrObj.length > 1) {
            var arrPara = arrObj[1].split("&");
            var arr;

            for (var i = 0; i < arrPara.length; i++) {
                 arr = arrPara[i].split("=");

                if (arr != null && arr[0] === paraName) {
                    return arr[1];
                }
            }
            return "";
        } else {
            return "";
        }
    }
</script>









  












  
  
    <script type="text/javascript" src="/limh/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/limh/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/limh/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/limh/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/limh/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/limh/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
